#ifndef COMMADN_H 
#define COMMADN_H

#include <my_header.h>

typedef enum {
    CMD_UNKNOWN, // 未知命令的默认值
    CMD_CD,     // 对应 "cd"
    CMD_LS,     // 对应 "ls"
    CMD_PWD,    // 对应 "pwd"
    CMD_PUTS,   // 避免与标准库冲突，改为 "CMD_PUTS"
    CMD_GETS,   // 避免与标准库冲突，改为 "CMD_GETS"
    CMD_RM,
    CMD_MKDIR,
    CMD_RMDIR,
    CMD_EXIT,
} CommandType;

typedef enum
{
    RESPON_OK,
    RESPON_ERROR
} ResponType;

typedef struct train_s {
    int type;
    int length;
    char value[1000];
} train_t;

int validate_and_parse_command(int sockfd);
CommandType get_command_type(const char* input);
int sendTrain(int type, int length, char *value);
int commandTrainAssignment(train_t *train, char *p);
/* int cmd_puts(char *fileName, int sockfd); */
/* int cmd_gets(int sockfd); */
int recvFile(int socket_fb);
int sendFile(char* fileName,int netfb);
void print_files_in_dir(void);

#endif
